from selenium import webdriver

from time import sleep

driver = webdriver.Chrome()
# driver.get(r'D:\BaiduNetdiskDownload\xpath.html')
# driver.find_element('xpath', "//input[contains(@class, 'st') and @name='user']").send_keys('admin')
# sleep(3)
# # driver.quit()
# # sleep(5)
driver.get('http://www.baidu.com')
# driver.find_element('css selector', "input[id='kw']").send_keys('京东')
driver.find_element('xpath', "//input[@id='kw']").send_keys('京东')
# driver.find_element('css selector', "form input[id='su']").click()
# driver.find_element('css selector', "#su").click()
driver.find_element('xpath', "//input[@id='su']").click()
sleep(3)
# driver.find_element('xpath', "//h3[@class='c-title t t tts-title']/a[@tabindex='0']").click()
driver.find_element('css selector', "div[id='3'] a[tabindex='0']").click()
sleep(3)
# driver.find_element('xpath', "//div[@id='search']/div/div[2]/input").send_keys('我服了...')
sleep(2)
driver.quit()
